package com.yungu.swift.system.finance.dao;

import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.yungu.swift.base.mapper.IMapper;
import com.yungu.swift.system.finance.model.dto.FinanceOrderDto;
import com.yungu.swift.system.finance.model.param.AdminOrderPayParam;
import com.yungu.swift.system.finance.model.vo.FinanceOrderVo;
import com.yungu.swift.system.finance.model.vo.OrderPayDetailVo;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface FinanceOrderMapper extends IMapper<FinanceOrderDto> {


    PageList<FinanceOrderVo> queryPageVo(Map<String, Object> map, PageBounds pageBounds);

    /**
     * 订单支付查询（EXCEL导出）--注意与分页方法保持同名
     *
     * @param map 参数集合
     * @return List
     * @author xiuyin.cui
     * @date 2018/10/23
     */
    List<FinanceOrderVo> queryPageVo(Map<String, Object> map);

    /**
     * 查询已支付订单量及金额
     *
     * @param map
     * @return
     */
    FinanceOrderVo findPaidOrder(Map<String, Object> map);

    /**
     * 查询未支付订单量及金额
     *
     * @param map
     * @return
     */
    FinanceOrderVo findUnpaidOrder(Map<String, Object> map);

    /**
     * 司机今日流水
     *
     * @param driverUuid
     * @return
     */
    BigDecimal queryTodayTotalIncome4Driver(String driverUuid);

    /**
     * 司机收入
     *
     * @param map
     * @return
     */
    BigDecimal findIncomeByTime(Map<String, Object> map);

    /**
     * 查询thawDay天之前司机抽成流水
     *
     * @param thawDay
     * @return
     */
    List<FinanceOrderDto> findByThawDay(@Param("thawDay") Integer thawDay);

    /**
     * 司机收入
     *
     * @param params
     * @return
     */
    BigDecimal getDriverTotalMoney(Map<String, Object> params);

    /**
     * 分页查询司机流水
     *
     * @param params     Map
     * @param pageBounds PageBounds
     * @return PageList
     */
    PageList driverBill(Map<String, Object> params, PageBounds pageBounds);

    /**
     * 订单支付统计
     */
    PageList<OrderPayDetailVo> payDetail(Map<String, Object> params,PageBounds pageBounds);

    /**
     * 订单支付统计
     */
    List<OrderPayDetailVo> exportPayDetail(Map<String, Object> params);
}